package com.platform.usercenter.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.platform.common.core.enums.UserManagerEnum;
import com.platform.usercenter.domain.*;
import com.platform.usercenter.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;



/**
 * 用户 公共接口处理
 *
 * @author
 */
@Slf4j
@Service
public class SysUserCommonServiceImpl implements ISysUserCommonService
{


    @Resource
    private ISysOrganizationAdministratorService administratorService;

    @Override
    public boolean isAdmin(Long userId) {
        SysOrganizationAdministrator organizationAdministrator = new SysOrganizationAdministrator();
        organizationAdministrator.setUserId(userId);
        organizationAdministrator.setCode(UserManagerEnum.SUPER_ADMINISTRATOR.name());
        List<SysOrganizationAdministrator> administratorList=administratorService.selectSysOrganizationAdministratorList(organizationAdministrator);
        if(CollectionUtil.isNotEmpty(administratorList)){
            return true;
        }else {
            return false;
        }
    }


}
